package com.jshx.sz.gdjt.thread.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import com.jshx.sz.gdjt.control.TextEditView;

public class Data4 implements IDataCon {

	@Override
	public String LocalMapToServerString(HashMap map) {
		String re="";
		//基本信息
		if(map.containsKey("device_num"))		{re+=",'check_resault4_input_2_3':'"+map.get("device_num")+"'";}
		if(map.containsKey("device_type"))		{re+=",'check_resault4_input_2_1':'"+map.get("device_type")+"'";}
		if(map.containsKey("version_num"))		{re+=",'check_resault4_input_2_5':'"+map.get("version_num")+"'";}
		if(map.containsKey("product_factory"))	{re+=",'check_resault4_input_2_7':'"+map.get("product_factory")+"'";}
		
		if(map.containsKey("work_date"))		
		{
			String work_date=map.get("work_date")+"";
			if(work_date!=null&&!work_date.equals(""))
			{
				work_date=work_date.replaceAll(" ", "%20");
			}
			re+=",'check_resault4_input_2_2':'"+work_date+"'";
		}
		if(map.containsKey("rated_current"))	{re+=",'check_resault4_input_2_4':'"+map.get("rated_current")+"'";}
		if(map.containsKey("rated_voltage"))	{re+=",'check_resault4_input_2_6':'"+map.get("rated_voltage")+"'";}
		if(map.containsKey("install_address"))	{re+=",'check_resault4_input_2_8':'"+map.get("install_address")+"'";}
		
		//定值
		if(map.containsKey("zddl1"))		{re+=",'check_resault4_input_2_9':'"+map.get("zddl1")+"'";} 
		if(map.containsKey("zdsx1"))		{re+=",'check_resault4_input_2_10':'"+map.get("zdsx1")+"'";}
		if(map.containsKey("dzdl1"))		{re+=",'check_resault4_input_2_11':'"+map.get("dzdl1")+"'";}
		if(map.containsKey("dzsx1"))		{re+=",'check_resault4_input_2_12':'"+map.get("dzsx1")+"'";}
		
		if(map.containsKey("zddl2"))		{re+=",'check_resault4_input_2_13':'"+map.get("zddl2")+"'";}
		if(map.containsKey("zdsx2"))		{re+=",'check_resault4_input_2_14':'"+map.get("zdsx2")+"'";}
		if(map.containsKey("dzdl2"))		{re+=",'check_resault4_input_2_15':'"+map.get("dzdl2")+"'";}
		if(map.containsKey("dzsx2"))		{re+=",'check_resault4_input_2_16':'"+map.get("dzsx2")+"'";}
		
		if(map.containsKey("qddlz1"))		{re+=",'check_resault4_input_2_17':'"+map.get("qddlz1")+"'";}
		if(map.containsKey("xl1_1"))		{re+=",'check_resault4_input_2_18':'"+map.get("xl1_1")+"'";}
		if(map.containsKey("xl1_2"))		{re+=",'check_resault4_input_2_19':'"+map.get("xl1_2")+"'";}
		if(map.containsKey("lxdgd1"))		{re+=",'check_resault4_input_2_20':'"+map.get("lxdgd1")+"'";}
		
		if(map.containsKey("qddlz2"))		{re+=",'check_resault4_input_2_21':'"+map.get("qddlz2")+"'";}
		if(map.containsKey("xl2_1"))		{re+=",'check_resault4_input_2_22':'"+map.get("xl2_1")+"'";}
		if(map.containsKey("xl2_2"))		{re+=",'check_resault4_input_2_23':'"+map.get("xl2_2")+"'";}
		if(map.containsKey("lxdgd2"))		{re+=",'check_resault4_input_2_24':'"+map.get("lxdgd2")+"'";} 
		
		//传动
		if(map.containsKey("cdvalue1"))		{re+=",'check_resault4_input_1_25':'"+map.get("cdvalue1")+"'";}
		if(map.containsKey("cdvalue2"))		{re+=",'check_resault4_input_1_26':'"+map.get("cdvalue2")+"'";}
		if(map.containsKey("cdvalue3"))		{re+=",'check_resault4_input_1_27':'"+map.get("cdvalue3")+"'";}
		if(map.containsKey("cdvalue4"))		{re+=",'check_resault4_input_1_28':'"+map.get("cdvalue4")+"'";}
		if(map.containsKey("cdvalue5"))		{re+=",'check_resault4_input_1_29':'"+map.get("cdvalue5")+"'";}
		
		//结论
		if(map.containsKey("resualt"))		{re+=",'check_resault4_input_1_30':'"+map.get("resualt")+"'";}
		if(map.containsKey("hjr_id"))		
		{
			re+=",'check_resault4_input_5_31':'"+map.get("hjr_id")+"'";
			re+=",'workNo2':'"+map.get("hjr_id")+"'";
		}
		
		//备注
		if(map.containsKey("remark"))		
		{
			String remark=map.get("remark")+"";
			String[] team=remark.split(";");
			for(int i=0;i<team.length;i++)
			{
				String[] obj=team[i].split("#");
				if(obj.length==3)
				{
					re+=",'check_resault4_input_4_"+(10000*(i+1)+1)+"':'"+obj[0]+"'";
					re+=",'check_resault4_input_4_"+(10000*(i+1)+2)+"':'"+obj[1]+"'";
					re+=",'check_resault4_input_4_"+(10000*(i+1)+3)+"':'"+obj[2]+"'";
				}
			}
		}
		
		//图片
		for(int i=1;i<6;i++)
		{
			if(map.containsKey("cdimg"+i))
			{
				String cdimg=map.get("cdimg"+i)+"";
				if(cdimg!=null&&!cdimg.equals(""))
				{
					re+=",'check_resault4_input_3_"+(31+i)+"':'"+cdimg+"'";
				}
			}
		}
			
		return re;
	}

	@Override
	public void proImg(String parentId, String key, ArrayList list) {
		
		
		 
	}

}
